package tech.aistar.corejava.day13.exercise;

import tech.aistar.corejava.day13.Product;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: lya
 * @Description: 本类的作用描述:
 * @CreateDate: 2019/8/2
 * @Version: 1.0
 */
public class TestProduct {
    public static void main(String[] args) {
        //模拟数据
        List<Product> list = new ArrayList<>();
        Product p1 = new Product("宝洁","洗手粉",18.5);
        Product p2 = new Product("联合利华","肥皂",4.5);
        Product p3 = new Product("宝洁","牙膏",32.5);
        Product p4 = new Product("宝洁","毛巾",14.5);
        Product p5 = new Product("洁利","洗面奶",26.0);
        Product p6 = new Product("好迪","洗发水",27.5);
        Product p7 = new Product("多芬","沐浴露",38.5);
        Product p8 = new Product("宝洁","洗洁精",3.4);

        IProductDao productDao = new ProductDaoImpl();

        //先加2个
        list.add(p1);
        list.add(p2);



//        productDao.save(p4);
//        productDao.save(p5);

        //删除
        productDao.delByrand("宝洁");
        //List<Product> list = productDao.findAll();

        if(null!=list){
            list.forEach(System.out::println);
        }else{
            System.out.println("文件读取失败!");
        }
    }
}
